package com.ht.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ht.domain.bo.TbScheduleBO;
import com.ht.domain.po.TbSchedule;
import com.ht.mapper.TbScheduleMapper;
import com.ht.service.TbScheduleService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class TbScheduleServiceImpl implements TbScheduleService {
    @Autowired
    private TbScheduleMapper tbScheduleMapper;


    @Override
    public List<TbScheduleBO> queryDoctorBydata(String format) {
        QueryWrapper q = new QueryWrapper();
        q.eq("work_date",format);
        List<TbSchedule> list = tbScheduleMapper.selectList(q);
        List<TbScheduleBO> listt = new ArrayList<>();
        list.forEach(obj->{
            TbScheduleBO bo = new TbScheduleBO();
            BeanUtils.copyProperties(obj,bo);
            listt.add(bo);
        });
        return listt;
    }
}
